<!-- 考核得分明细 -->
<template>
  <table>
    <thead>
      <tr>
        <th :colspan="type === 'auto' ? 4 : 3">总分：{{ totalScore }}分</th>
      </tr>
      <tr>
        <th class="index t-c">序号</th>
        <th>考核项</th>
        <th v-show="type === 'auto'" class="t-c">百分比</th>
        <th class="t-c">得分</th>
      </tr>
    </thead>
    <tbody>
      <tr v-for="(item, index) in examineList" :key="index">
        <td class="t-c">{{ index + 1 }}</td>
        <td>{{ item.name }}</td>
        <td v-show="type === 'auto'" class="t-c">{{ item.weight }}%</td>
        <td class="t-c">{{ item.score }}</td>
      </tr>
    </tbody>
  </table>
</template>

<script>

export default {
  name: 'ExamineScoreTable',
  props: {
    // 表格类型 auto-自动 qualitative-定性
    type: {
      type: String,
      default: 'auto'
    },
    totalScore: {
      type: String,
      default: '0'
    },
    examineList: {
      type: Array,
      default: () => []
    },
  },
  data() {
    return {
    };
  },
  methods: {
  }
}
</script>

<style lang="less" scoped>
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
}
table, th, td {
  border: 1px solid #ccc;
}
th, td {
  padding: 8px;
}
/* 表头样式 */
th {
  background-color: rgba(239, 246, 253, 1);
}

.t-c {
  text-align: center;
}
.index {
  width: 70px;
}
</style>